package com.feelingj.spring.boot.blog.controller;

import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.feelingj.spring.boot.blog.domain.User;

@Controller
@RequestMapping("/authentications")
public class HelloController {
	
	@RequestMapping("/index")
	public String index() {
		Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
		String name = authentication.getName();
//		User principal = (User) authentication.getPrincipal();
		Object principal = authentication.getPrincipal();
		return "error";
	}

}
